a11y(2.1.1): fake-button widgets — replace deprecated onkeypress with onkeydown handling Enter and Space#3528
Open
rosanusi wants to merge 1 commit into
Open
Conversation
…ton widgets keypress is deprecated and does not reliably fire for Space in Firefox; pressing Space also scrolled the page before activating the widget. Replace all three call sites with onkeydown handlers that match Enter and ' ', call preventDefault() to suppress page scroll, and invoke the existing click handler. Closes matrix defect (c). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & motivation 💭
Three fake-button widgets (
<div role="button">/<g role="button">) used the deprecatedonkeypressevent to activate on keyboard input. Two problems:keypressis deprecated — unreliable for Space in Firefox; modern guidance iskeydownwith explicit key matching.preventDefault()on Space — pressing Space activates the widget and scrolls the page (or scrollable SVG ancestor), causing a jarring jump before the action fires.This PR replaces all three call sites with
onkeydownhandlers that matchEnterand' '(Space), callpreventDefault()to suppress scroll, and invoke the existing click handler. The mouseonclick/on:clickpaths are untouched.Files changed (3):
src/lib/holocene/navigation/navigation-button.svelte— bottom-nav settings/namespace-picker/feedback buttons (finding #2b)src/lib/components/lines-and-dots/svg/timeline-graph-row.svelte— interactive timeline-graph event row; closes matrix defect (c) (finding [Styling] Font Change #8)src/lib/components/workflow/relationships/workflow-family-node-tree.svelte— two<g role="button">family-tree nodes (finding Show workflows in UI #9)SC: 2.1.1 Keyboard (Level A) — current verdict: Fails → Supports (for these three widgets)
Screenshots (if applicable) 📸
No visual change. Keyboard behaviour change only.
Design Considerations 🎨
None — no design tokens or layout affected.
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
navigation-button— Tab to the settings / namespace-picker / feedback button in the bottom nav. Press Enter: confirm activation. Press Space: confirm activation without page scroll.timeline-graph-row— Open a workflow with a timeline graph (xl viewport). Tab into the SVG and onto a graph row. Press Enter: confirm the active-group selection expands. Press Space: confirm activation without scrolling the graph container.workflow-family-node-tree— Open a workflow relationships view. Tab through family-tree nodes. Press Enter and Space on each: confirm node selection fires. Confirm Space does not scroll the ZoomSvg pan container.keypress-on-Space was previously inconsistent. Both Enter and Space should now activate reliably.{name}, button; activate with VO+Space and Enter; both should fire.Checklists
Draft Checklist
Merge Checklist
keypress)Issue(s) closed
Closes findings #2b, #8, #9 from
audit-output/issues/2.1.1-keyboard-audit.md.Closes matrix defect (c) recorded at
audit-output/vpat-matrix.md:119.Docs
Any docs updates needed?
No doc changes needed.
A11y-Audit-Ref: 2.1.1-fake-button-keypress-to-keydown